package uc108.com.jetpackdemo.activity;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import uc108.com.jetpackdemo.R;
import uc108.com.jetpackdemo.fragment.LeftFragment;
import uc108.com.jetpackdemo.fragment.RightFragment;

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);


        init();
    }


    private void init() {
        LeftFragment left = new LeftFragment();
        RightFragment right = new RightFragment();
        getSupportFragmentManager().beginTransaction().replace(R.id.fragment_left, left)
                .replace(R.id.fragment_right, right)
                .commit();
    }
}
